<?php

if (isset($_GET['resetuserdata']))
{
    file_put_contents(_SETTINGSPATH_ . '/userdata.ser', serialize(array(
                'admin' => array(
                    'name' => 'Admin',
                    'password' => sha1('password'),
                    'permissions' => array(
                        'id' => 'administrator'
                    ),
                    'deleteable' => false
                ),
                'guest' => array(
                    'name' => 'guest',
                    'password' => sha1('guest'),
                    'permissions' => array(
                        'id' => 'guest'
                    ),
                    'deleteable' => false
                ),
            )));
}


if (isset($_GET['resetusergroups']))
{
    file_put_contents(_SETTINGSPATH_ . '/usergroups.ser', serialize(array(
                'administrator' => array(
                    'id' => 'administrator',
                    'modify' => array(
                        'page' => true,
                        'file' => true,
                        'module' => true,
                        'user' => 'all'
                    ),
                    'create' => array(
                        'page' => true,
                        'file' => true,
                        'module' => true,
                        'user' => true
                    ),
                    'delete' => array(
                        'page' => true,
                        'file' => true,
                        'module' => true,
                        'user' => 'all'
                    )
                ),
                'moderator' => array(
                    'id' => 'moderator',
                    'modify' => array(
                        'page' => true,
                        'file' => true,
                        'module' => true,
                        'user' => 'own'
                    ),
                    'create' => array(
                        'page' => true,
                        'file' => true,
                        'module' => false,
                        'user' => false
                    ),
                    'delete' => array(
                        'page' => true,
                        'file' => true,
                        'module' => false,
                        'user' => 'own'
                    )
                ),
                'guest' => array(
                    'id' => 'guest',
                    'modify' => array(
                        'page' => false,
                        'file' => false,
                        'module' => false,
                        'user' => false
                    ),
                    'create' => array(
                        'page' => false,
                        'file' => false,
                        'module' => false,
                        'user' => false
                    ),
                    'delete' => array(
                        'page' => false,
                        'file' => false,
                        'module' => false,
                        'user' => false
                    )
                )
            )));
}
?>